/*****************************************************************
*
*	Netcare Agent Project
*		Copyright(C) 2010, Wicresoft EKA. All Rights Reserved.
*
*	Authors:
*		Miles Chen (milesch@wicresoft.com)
*		TingRong Shi (trshi@wicresoft.com)
*
*	Part of the product code depends on gSOAP under GPL license
*		Copyright(C) 2000-2010, Robert van Engelen, Genivia Inc. All Rights Reserved.
*
*****************************************************************/
#pragma once
#include <vector>

#include "ns.h"
#include "LogListener.h"

NETCARE_AGENT;

USING_STD;

class CLog
{
public:
	CLog(void);
	~CLog(void);

	static const CLog* Current();

	void WriteInfo() const;
	void WriteInfo(const wchar_t* format, ...) const;
	void WriteInfo(const char* format, ...) const;

	void WriteError() const;
	void WriteError(const wchar_t* format, ...) const;
	void WriteError(const char* format, ...) const;

	void WriteDebug() const;
	void WriteDebug(const wchar_t* format, ...) const;
	void WriteDebug(const char* format, ...) const;

private:
	static CLog _instance;

	vector<CLogListener*> _listeners;
	wchar_t* _bufferW;
	char* _buffer;
};

ENDNS ENDNS